package com.tianma315.admin.stock.service;

//                   _ooOoo_
//                  o8888888o
//                  88" . "88
//                  (| -_- |)
//                  O\  =  /O
//               ____/`---'\____
//             .'  \\|     |//  `.
//            /  \\|||  :  |||//  \
//           /  _||||| -:- |||||-  \
//           |   | \\\  -  /// |   |
//           | \_|  ''\---/''  |   |
//           \  .-\__  `-`  ___/-. /
//         ___`. .'  /--.--\  `. . __
//      ."" '<  `.___\_<|>_/___.'  >'"".
//     | | :  `- \`.;`\ _ /`;.`/ - ` : | |
//     \  \ `-.   \_ __\ /__ _/   .-` /  /
//======`-.____`-.___\_____/___.-`____.-'======
//                   `=---='
//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
//         佛祖保佑       永无BUG

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.plugins.Page;
import com.tianma315.admin.common.base.CoreService;
import com.tianma315.admin.material.domain.PurchaseDO;
import com.tianma315.admin.stock.domain.Stock;
import com.tianma315.admin.stock.domain.WarehousingRecord;
import com.tianma315.admin.stock.domain.vo.WarehousingRecordAndArrtVO;
import com.tianma315.admin.stock.domain.vo.WarehousingRecordVo;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Param;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.List;

/**
 * Description
 * <p>
 * Created by zcm on 2019/5/28.
 */
public interface StockService extends CoreService<WarehousingRecord> {

    Page<WarehousingRecordVo> getPage(int pageNumber, int pageSize, String searchKey);



    /**
     * 保存入库记录
     *
     * @param record
     * @return
     */
    boolean save(WarehousingRecord record);

    /**
     *
     * @param record_id
     * @return
     */
    boolean revert(long record_id);

    boolean batchRevert(Long[] ids);

    List<WarehousingRecordAndArrtVO> statisticsTable(Page page,List<Integer> productIds,Date beginDate,Date endDate);

    List<WarehousingRecordAndArrtVO> statisticsAllTable(Date beginDate,Date endDate);

    Page<WarehousingRecordAndArrtVO> warehousingRecordAndArrtInfo(
            Integer pageNumber,Integer pageSize,String productName, Date beginDate, Date endDate);

    Page<JSONObject> getDataJson(Integer pageNumber,Integer pageSize, String productName, Date beginDate, Date endDate);

    List<JSONObject> getHead();

    HSSFWorkbook exportStock();

    void importStock(MultipartFile file, Long userId);

    List<WarehousingRecordVo> getWarehousingRecordByBatchAndProductName(String batch,String productName);

    WarehousingRecordVo getWarehousingRecordById(Integer warehousingRecordId);

    void updateStockById(long productId, Integer lastNum, Integer number);

    void insertImg(HttpServletRequest request, WarehousingRecord warehousingRecord);

    boolean updateWareById(WarehousingRecord warehousingRecord);
}
